<template>
	<view>
			<scroll-view scroll-y="true" :scroll-into-view="intoView" :style="`height: 300px`" scroll-with-animation="true">
				<view class="item" v-for="(item, index) in arr" :key="index" :id='"text" + (index+1)'>{{ item }}</view>
			</scroll-view>
			<button @tap="move(1)">点击移动至1</button>
			<button @tap="move(2)">点击移动至2</button>
			<button @tap="move(3)">点击移动至3</button>
			<button @tap="move(4)">点击移动至4</button>
			<button @tap="move(5)">点击移动至5</button>
			<button @tap="move(6)">点击移动至6</button>
		</view>
</template>

<script>
	export default {
			data() {
				return {
					arr: [1,2,3,4,5,6],
					intoView: ''
				}
			},
			methods: {
				move(num) {
					this.$nextTick(()=> {
						this.intoView = "text" + num
						console.log(this.intoView)
						//this.intoView = ''
					})
				}
			}
		}
</script>

<style>
 .item{
	 width: 100%;
	 height: 200px;
 }
</style>
